class A
{
    void f()
    {
        System.out.printf("AAAA\n");
    }
}
class B extends A
{
  void f()
    {
        System.out.printf("BBBB\n");
    }
}
class C extends B
{
   public void f()
    {
        System.out.printf("BBBB\n");
    }
}
public class TestPoly_4
{
    static public void g(A aa)
    {
        aa.f();
    }
    public static void main(String[] args)
    {
        B bb = new B();
        g(bb);
    }
}